from django.contrib.auth.models import Permission, ContentType
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.my_paginate import MyPageNumberPagination
from meiduo_admin.serializer import permission_serializer
from rest_framework.generics import ListAPIView



class PermissionView(ModelViewSet):
    pagination_class = MyPageNumberPagination
    serializer_class = permission_serializer.PermissionSerializer
    queryset = Permission.objects.all()


class PermissionContentView(ListAPIView):
    serializer_class = permission_serializer.ContentTypeSerializer
    queryset = ContentType.objects.order_by('id')


